package com.example.game.grpc;

import com.example.game.proto.internal.*;
import io.grpc.stub.StreamObserver;
import lombok.extern.slf4j.Slf4j;
import net.devh.boot.grpc.server.service.GrpcService;
import org.springframework.stereotype.Service;

/**
 * @author: Allen
 * @create: 2025/7/3 16:43
 * @description:
 **/
@Slf4j
@GrpcService
@Service
public class GrpcServiceImpl extends GrpcServiceGrpc.GrpcServiceImplBase {

    @Override
    public void heartbeat(SrvReq request, StreamObserver<SrvResp> responseObserver) {
        SrvResp build = SrvResp.newBuilder().setRet(0).build();
        responseObserver.onNext(build);
        responseObserver.onCompleted();
    }

    @Override
    public void process(SrvReq request, StreamObserver<SrvResp> responseObserver) {
        log.warn("Received SrvReq request");
    }
}
